<?php


if (!isset($_SESSION["sessionID"]) && (isset($_POST['nom'])) && (isset($_POST['pass']))) {
echo $_POST['nom'];
		$consulta = mysql_query("select * from usuari", $conexion);
	while ($fila = mysql_fetch_array($consulta)) {
		if (($fila['alias'] == trim($_POST["nom"])) && ($fila['contrasenya'] == (trim($_POST["pass"])))) {
			$_SESSION["sessionID"] = session_id();
			$_SESSION["username"] = $fila['alias'];
			$_SESSION["idUsuari"] = $fila['idUsuari'];
			$_SESSION["nom"] = $fila['nomUsuari'];
		}
	}
}

?>
